import request from '@/utils/request'

// 查询事项版本列表
export function listAppVersion(query) {
  return request({
    url: '/flowable/appVersion/list',
    method: 'get',
    params: query
  })
}

// 查询事项版本详细
export function getAppVersion(versionId) {
  return request({
    url: '/flowable/appVersion/' + versionId,
    method: 'get'
  })
}

// 新增事项版本
export function addAppVersion(data) {
  return request({
    url: '/flowable/appVersion',
    method: 'post',
    data: data
  })
}

// 修改事项版本
export function updateAppVersion(data) {
  return request({
    url: '/flowable/appVersion',
    method: 'put',
    data: data
  })
}

// 删除事项版本
export function delAppVersion(versionId) {
  return request({
    url: '/flowable/appVersion/' + versionId,
    method: 'delete'
  })
}

// 部署流程
export function deployBpmn(appVersionId) {
  return request({
    url: '/flowable/appVersion/deployBpmn/' + appVersionId,
    method: 'get'
  })
}

// 复制版本
export function copyVersion(appVersionId) {
  return request({
    url: '/flowable/appVersion/copyVersion/' + appVersionId,
    method: 'get'
  })
}

// 设置使用版本
export function setUseVersion(appVersionId) {
  return request({
    url: '/flowable/appVersion/setUseVersion/' + appVersionId,
    method: 'get'
  })
}

// 新增节点配置
export function addBpmnConfig(data) {
  return request({
    url: '/flowable/bpmnConfig',
    method: 'post',
    data: data
  })
}
